#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<ctype.h>

int My_atoi(const char* str)
{
	int flag=1;
	int ret = 0;
	
	while (isspace(*str))
	{
		str++;
	}
		
		


			if (*str == '-')
			{
				flag = -1;
				str++;
			}
			else if(*str == '+')
			{
				flag = 1;
				str++;
			}
			while (*str) {
			if (isdigit(*str))
			{
				ret = (ret * 10 + ((*str) - '0')) * flag;
			}

			else
				return 0;

			str++;

		}
		return ret;





}








int main()
{

	char* t = "   +12-3";
	int ret = atoi(t);
	printf("%d\n", ret);
	return 0;
}